package com.soujiayi.activity;

import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;


public class ContactUsActivity extends Activity {
	
	private TextView tv_sina;
	private TextView tv_tencent;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		((MyApplication) this.getApplication()).addActivity(this);
		setContentView(R.layout.contact_us);
		tv_sina = (TextView) findViewById(R.id.settings_contact_sina);
		tv_sina.setText(Html.fromHtml("新浪微博：<a href=\"http://weibo.cn/soujiayi\">http://e.weibo.com/soujiayi</a>"));
		tv_sina.setMovementMethod(LinkMovementMethod.getInstance()); 
		
		tv_tencent = (TextView) findViewById(R.id.settings_contact_tencent);
		tv_tencent.setText(Html.fromHtml("腾讯微博：<a href=\"http://ti.3g.qq.com/g/s?aid=h&hu=soujiayi2012\">http://t.qq.com/soujiayi2012</a>"));
		tv_tencent.setMovementMethod(LinkMovementMethod.getInstance()); 
	}
	
	public void back(View view) {
		this.finish();
		overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);
	}
	
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		//如果按下的是返回键，并且没有重复
		if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
			finish();
			overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);
			return false;
		}
		return false;
	}

}
